<!doctype html>
<html><!-- InstanceBegin template="/Templates/cloud.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
<!-- InstanceBeginEditable name="doctitle" -->
<title>智能云管家-登录</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="EditRegion-jscode" -->
<script type="text/javascript" src="resources/appMobi-jQ.Mobi-3d025ab/jq.mobi.min.js"></script>

<script type="text/javascript" src="resources/js/common.js"></script>
<script src="resources/js/cordova-2.1.0.js"></script>

<script src="resources/js/phonegap_login.js"></script>

<script type="text/javascript" src="resources/cubiq-iscroll-a8b8720/src/iscroll.js"></script>
<script type="text/javascript">
$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
    if(localStr.indexOf("file:///",0)<0)
	{
	    $(window).scroll(function(){
	    $("#footer").offset({top:$(document).scrollTop()+top});
	    });
	}
        }

       });
var myScroll;
var localStr=window.location.href;
var israndom="no";
function loaded() {
	myScroll = new iScroll('wrapper', {
		snap: true,
		momentum: false,
		hScrollbar: false,
		onScrollEnd: function () {
			document.querySelector('#indicator > li.active').className = '';
			document.querySelector('#indicator > li:nth-child(' + (this.currPageX+1) + ')').className = 'active';
		}
	 });
}

document.addEventListener('DOMContentLoaded', loaded, false);
document.addEventListener("deviceready", onDeviceReady, false);
function play() {
	if($("#finalDot").hasClass("active")) {
		myScroll.scrollToPage('prev',0);
		myScroll.scrollToPage('prev',0);
		}else{
		myScroll.scrollToPage('next', 0);
		}
	}

$(document).ready(function(e) {
	$("#loading").hide();
	$(".floatBoxBg").hide();
	if(localStr.indexOf("file:///",0)>=0)
	{
		$("body").bind("load",function(){
			init();
		});
	}
	
	var useragent=navigator.userAgent;
	var w=window.screen.width;
	var h=window.screen.height;
	if(h/w>1.6){
		$("#blank1").get(0).style.height="500px";
	}
	if(useragent.indexOf("Android 4")>0)
	{
		$("meta").attr("content","width="+w/0.78+", initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5");
	}
	$("#content").get(0).style.height=h;
    setInterval("play()",4000);
    
   
	var userkey=localStorage.getItem("userkey");
	var curphone=localStorage.getItem("curphone");
	//alert("userkey:"+userkey+",curphone:"+curphone);
	if(null!=userkey && null!=curphone)
	{
		var jsonurl=jsonserver+"login/keystr/"+userkey+"/curphone/"+curphone;
		$.getJSON(jsonurl+".jsonp?callback=?",{},function(data){
			
			if(data.sb.status=="00000")
			{
				window.location.href="mybusiness.html";
			}
			else
			{
				localStorage.clear();
				window.location.href="login.html";
			}
		});
	}

	//TODO透传登陆需要补充,暂时跳过
	
	
	
});
		
		
    	//登陆
   	 	function login()
		{
		
			
			var phoneNumber=$("#phoneNo").val();
			if(!phoneNumber.match("^1(3[0-2]|5[56]|8[56])\\d{8}$")){
				$("#warning").text("输入手机号码不正确!");
				
				$("#phoneNo").focus();
				return false;
			}
			var password = $("#password").val();
			if($("#password").val().length == 0){
				$("#warning").text("密码不能为空");
				
				$("#password").focus();
				return  false;
			}
		
			var jsonurl=jsonserver+"login/phone/"+phoneNumber+"/password/"+password+"/israndom/"+israndom;  
			
			
					$.getJSON(jsonurl+".jsonp?callback=?",{}, 
						function(data) {
							//alert(data.sb.status);
							if(data.sb.status=="00000"){
								localStorage.setItem("userkey",data.userKey);
								localStorage.setItem("curphone",phoneNumber);
								localStorage.setItem("username",data.username);
								localStorage.setItem("newuser",data.isNewuser);
								localStorage.setItem("special",data.isSpecial);
								localStorage.setItem("package",data.pro_name);
								localStorage.setItem("ustate",data.userstateIsnormal);
								localStorage.setItem("height",window.screen.height);
								localStorage.setItem("width",window.screen.width);
								

								if(localStr.indexOf("file:///",0)>=0)
								{
									onDeviceReady();
								}
								loginshow();
								setTimeout(function(){
									window.location.href="mybusiness.html";
								},1000);
							}
							else{
								$("#warning").text("用户名或者密码错误!");
								return false;
							}
						});
		}
		function loginshow()
		{
				var offset = $("#finalDot").offset();
				var loadleft=offset.left;
				var loadtop=offset.top;
				var loadimg=$("<img>").attr("src","resources/css/images/loading.gif").css({
						"position":"absolute",
						"left":loadleft+"px",
						"top":loadtop+"px",
						"z-index":"9999"
					});
					$("body").append(loadimg);
					//loadimg.appendTo($("body"));
				$("body").append('<div class="floatBoxBg"></div>');
		}
		//获取随机密码
    	function getpasscode(){
			
			var objlogin_name =  $("#phoneNo").val();
       		 if(!objlogin_name.match("^1(3[0-2]|5[56]|8[56])\\d{8}$")){
				$("#warning").text("输入手机号码不正确!");
				$("#phoneNo").focus();
				return false;
        	}
       		 else
        	{
				var jsonurl=jsonserver+"login/phone/"+objlogin_name;        
				$.getJSON(jsonurl+".jsonp?callback=?",
					{}, 
					function(data) {
						if(data.sb.status=="00000"){
							israndom="yes";
							$("#warning").text("密码已经发送，请在60分钟内登陆！"); 
						}else{
							
							$("#warning").text("密码发送失败!");
							return false;
						}
					});
			}
	
		}
		
		
    

//}
</script>
<style type="text/css" media="all">
body {
	background-color:#F3F3F3
	}
.floatBoxBg{
	width:100%;
	height:300%;
	background:#181e2a;
	filter:alpha(opacity=50);
	opacity:0.5;
	position:absolute;
	top:0;left:0;
	z-index: 999;
	}
#wrapper {
	width: 100%;
	float: left;
	padding-left:5px;
	position: relative;	/* On older OS versions "position" and "z-index" must be defined, */
	z-index: 1;			/* it seems that recent webkit is less picky and works anyway. */
	overflow: hidden;
}

#scroller {
	width: 300%;
	height: 100%;
	float: left;
	padding: 0;
}


		.carousel_paging2_selected {
			border-radius: 5px;
			text-align:center;
			background:#666;
			width: 5px;
			height: 5px;
			float: left;
			
		}
    

#scroller ul {
	list-style:none;
	display:block;
	float:left;
	width:100%;
	height:100%;
	padding:0;
	margin:0;
	text-align:left;
}


#scroller li {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
	display: block;
	float: left;
	width: 33.33%;
	padding-left:2px;
	text-align: center;
	font-family: georgia;
	font-size: 24px;
	line-height: 140%;
	color: #f22900;
}

#nav {
	width: 100%;
	float: left;
}

#prev, #next {
	float: left;
	font-weight: bold;
	font-size: 14px;
	padding: 3px 0;
	width: 43.5%;
}

#next {
	float:right;
	text-align:right;
}

#indicator, #indicator > li {
	display:block; float:left;
	list-style:none;
	padding:0; margin:0;
}

#indicator {
	width: 36px;
	height:50px
	padding-top: 10px;
	padding-right: 10px;
	padding-bottom: 0px;
	padding-left: 10px;
	padding-top: 10px;
}

#indicator > li {
	text-indent:-9999em;
	width:8px; height:8px;
	-webkit-border-radius:4px;
	-moz-border-radius:4px;
	-o-border-radius:4px;
	border-radius:4px;
	background:#ddd;
	overflow:hidden;
	margin-right:4px;
	background-image:url(resources/css/images/dian.jpg)
}

#indicator > li.active {
	background-image:url(resources/css/images/dian_on.png)
}

#indicator > li:last-child {
	margin:0;
}
#content {
	height:1150px;
	}
.floatBoxBg{
	width:100%;
	height:300%;
	background:#181e2a;
	filter:alpha(opacity=50);
	opacity:0.5;
	position:absolute;
	top:0;left:0;
	z-index: 999;
	text-align:center;
	vertical-align:central;
	}
    </style>
<style type="text/css">
</style>
<!-- InstanceEndEditable -->
<style type="text/css">
*{
	font-family:Heiti SC;
}
</style>
	<script type="text/javascript">
//var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
//document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
</script>
</head>

<body style="margin:0;">

	<div id="header">
	<!-- InstanceBeginEditable name="EditRegion-header" -->
    <div style="text-align:center; background-image:url(resources/css/images/top_bg.jpg); height:88px; line-height:88px; font-size:40px; color:#1e1e1e">
    智能云管家
    </div>
	<!-- InstanceEndEditable -->
    </div>
    <div id="content">
    <div id="loading" class="loading"><img src="resources/css/images/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>
	<!-- InstanceBeginEditable name="EditRegion-content" -->
       <div align="center" id="wrapper" style="background-image: url(resources/css/images/black_bg.jpg); background-size:contain">
	<div align="center" id="scroller">
		<ul id="thelist">
			<li>
                <table width="100%" border="0">
                  <tr>
                    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login01.png"/></td>
                    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic01.png"/></td>
                  </tr>
                  <tr>
                    <td style="font-size:40px; color:#FFF; padding-top:20px">流量变化随时掌握</td>
                  </tr>
                  <tr>
                    <td style="padding-top:20px;">还在为不知何时超出的流量而买单吗？</td>
                  </tr>
                  <tr>
                    <td><img src="resources/css/images/pic2_12.png"/></td>
                  </tr>
            </table>
        </li>
			<li><table width="100%" border="0">
  <tr>
    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login03.png"/></td>
    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic02.png"/></td>
  </tr>
  <tr>
    <td style="font-size:40px; color:#FC3; padding-top:20px">套餐智能更换</td>
  </tr>
  <tr>
    <td style="padding-top:20px;">流量超出，短信却用不完，有没有更合适的业务呢？</td>
  </tr>
  <tr>
    <td><img src="resources/css/images/pic2_12.png"/></td>
  </tr>
</table></li>
			<li><table width="100%" border="0">
  <tr>
    <td style="padding-top:15px" rowspan="4" width="44%" align="center"><img src="resources/css/images/login/images/login02.png"/></td>
    <td style="padding-top:40px"><img src="resources/css/images/login/images/pic03.png"/></td>
  </tr>
  <tr>
    <td style="font-size:40px; color:#FFF; padding-top:20px">懂你喜欢</td>
  </tr>
  <tr>
    <td style="padding-top:20px; color:#FC3">好玩、fashion的应用，你喜欢的都在这里啦~~</td>
  </tr>
  <tr>
    <td><img src="resources/css/images/pic2_12.png"/></td>
  </tr>
</table></li>
		</ul>
	</div>
</div>

<div id="nav">
	<div id="prev" onclick="myScroll.scrollToPage('prev', 0);return false"></div>
	<ul id="indicator">
	  <li class="active">1</li>
		<li>2</li>
		<li id="finalDot">3</li>
	</ul>
	<div id="next" onclick="myScroll.scrollToPage('next', 0);return false"></div>
</div>
<div id="blank1" style="width:100%; height:0px"></div>
<div style="width:100%; padding-top:45px" align="center">
   
    <table width="100%" border="0">
      <tr height="70px">
    <td width="30%" align="right" valign="middle" style="text-align: right; font-size: 32px;  font-family:'黑体'; line-height:80px">电话号码：</td>
    <td colspan="3" align="left" valign="middle" ><input type="tel" placeholder="请输入电话号码" style=" border-radius:15px; width:70%; height:50px; font-size:30px" id="phoneNo"/></td>
    </tr>
  <tr height="70px">
    <td height="39" align="right" valign="middle" style="text-align: right; font-size: 32px; line-height:80px; font-family:'黑体';">验 证 码 ：</td>
    <td colspan="3" align="left" valign="middle"><input type="password" placeholder="请输验证码或服务密码" style=" border-radius:15px; width:70%; height:50px; font-size:30px" id="password"/><br/></td>
    </tr>
    <tr>
    	<td colspan="4" style="height:30px; font-family:'黑体';font-size:32px; color:#F00; text-align:center; " id="warning"></td>
    </tr>
  <tr height="70px" style="margin:20px">
    <td>&nbsp;</td>
    <td><img src="resources/css/images/btn01_17.png" onclick="login()"/></td>
    <td><input type="image" src="resources/css/images/btn02_19.png" onClick="getpasscode()"/></td>
    <td width="18%">&nbsp;</td>
    </tr>
</table>
    </div>
	<!-- InstanceEndEditable -->
    </div>
    <!-- InstanceBeginEditable name="EditRegion-footer" -->
	<!-- InstanceEndEditable -->
    <div id="footer">
    </div>
    
</body>
<!-- InstanceEnd --></html>
